<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <style type="text/css">
            input[type='submit']{
                margin: 3px 5px 3px 5px;
                padding: 3px 5px 3px 5px;
            }
            .itemClass{
                width:20px;
            }
        </style>
    </h:head>
    <h:form>
        <rich:panel header="报废/报损申请" styleClass="content-hight">
            <a4j:commandButton value="申请报废"
                               action="#{psnAsset.askForScrapped}"
                               onclick="this.disabled = 'true';"
                               render="@this,dataGroup"/>
            <a4j:commandButton value="申请报损"
                               action="#{psnAsset.askForLost}"
                               onclick="this.disabled = 'true';"
                               render="@this,dataGroup"/>
            <a4j:commandButton value="撤销申请"
                               action="#{psnAsset.askForCancel}"
                               onclick="this.disabled = 'true';"
                               render="@this,dataGroup"/>
            <hr/>
            <h:panelGroup id="dataGroup">
                <rich:dataScroller for="assetList" />
                <div style="width:750px;overflow: auto;">
                    <rich:dataTable style="width:1200px;margin-bottom: 5px;"
                                    id="assetList"
                                    value="#{psnAsset.askForli}"
                                    rows="13"
                                    var="asset">
                        <rich:column style="text-align: center;width:40px;">
                            <f:facet name="header">
                                <h:outputText  value="选择"/>
                            </f:facet>
                            <h:selectBooleanCheckbox value="#{asset.selected}">
                                <a4j:ajax event="click" execute="@this" render="@none"/>
                            </h:selectBooleanCheckbox>
                        </rich:column>
                        <rich:column style="text-align: center;width:55px;">
                            <f:facet name="header">
                                <h:outputText  value="使用状况"/>
                            </f:facet>
                            <h:outputText value="在用" rendered="#{asset.useStatus eq 0}"/>
                            <h:outputText value="报废" rendered="#{asset.useStatus eq 1}" style="color: blue"/>
                            <h:outputText value="报损" rendered="#{asset.useStatus eq 2}" style="color: red"/>
                            <h:outputText value="其他" rendered="#{asset.useStatus eq 3}" style="color: orange"/>
                            <h:outputText value="申请报废" rendered="#{asset.useStatus eq 4}" style="color: #3baae3"/>
                            <h:outputText value="申请报损" rendered="#{asset.useStatus eq 5}" style="color: indianred"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText  value="资产编号"/>
                            </f:facet>
                            <h:outputText value="#{asset.assetCode}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText  value="资产名称"/>
                            </f:facet>
                            <h:outputText value="#{asset.assetName}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText  value="规格型号"/>
                            </f:facet>
                            <h:outputText value="#{asset.model}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText  value="单价"/>
                            </f:facet>
                            <h:outputText value="#{asset.price}"/>
                        </rich:column>
                        <rich:column style="width:160px;">
                            <f:facet name="header">
                                <h:outputText  value="保管地点"/>
                            </f:facet>
                            <h:outputText value="#{asset.place}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText  value="品牌"/>
                            </f:facet>
                            <h:outputText value="#{asset.brand}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText  value="厂商"/>
                            </f:facet>
                            <h:outputText value="#{asset.manufacture}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText  value="购置日期"/>
                            </f:facet>
                            <h:outputText value="#{asset.purchDate}">
                                <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                            </h:outputText>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText  value="质保日期"/>
                            </f:facet>
                            <h:outputText value="#{asset.shelfLife}">
                                <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                            </h:outputText>
                        </rich:column>
                        <rich:column style="width:160px;">
                            <f:facet name="header">
                                <h:outputText  value="备注"/>
                            </f:facet>
                            <h:outputText value="#{asset.memo}"/>
                        </rich:column>
                    </rich:dataTable>
                </div>
            </h:panelGroup>
        </rich:panel>
    </h:form>
</ui:composition>
